<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>LCV Framework: cam-target.c Quellcode</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Erzeugt von Doxygen 1.5.3 -->
<div class="tabs">
  <ul>
    <li><a href="index.html"><span>Hauptseite</span></a></li>
    <li><a href="classes.html"><span>Datenstrukturen</span></a></li>
    <li class="current"><a href="files.html"><span>Dateien</span></a></li>
  </ul>
</div>
<h1>cam-target.c</h1><a href="cam-target_8c.html">gehe zur Dokumentation dieser Datei</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 
<a name="l00009"></a>00009 <span class="preprocessor">#include &lt;sys/ioctl.h&gt;</span>
<a name="l00010"></a>00010 <span class="preprocessor">#include &lt;stdio.h&gt;</span>
<a name="l00011"></a>00011 <span class="preprocessor">#include &lt;stdlib.h&gt;</span>
<a name="l00012"></a>00012 <span class="preprocessor">#include &lt;fcntl.h&gt;</span>
<a name="l00013"></a>00013 <span class="preprocessor">#include &lt;linux/ioctl.h&gt;</span>
<a name="l00014"></a>00014 <span class="preprocessor">#include &lt;errno.h&gt;</span>
<a name="l00015"></a>00015 <span class="preprocessor">#include &lt;unistd.h&gt;</span>
<a name="l00016"></a>00016 <span class="preprocessor">#include &lt;getopt.h&gt;</span>
<a name="l00017"></a>00017 <span class="preprocessor">#include &lt;string.h&gt;</span>
<a name="l00018"></a>00018 <span class="preprocessor">#include &lt;strings.h&gt;</span> 
<a name="l00019"></a>00019 <span class="preprocessor">#include "<a class="code" href="cam_8h.html" title="Die Schnittstelle zur Kamera.">cam.h</a>"</span>
<a name="l00020"></a>00020 <span class="preprocessor">#include "<a class="code" href="cam-reg-config_8h.html" title="Enthält die Konfiguration der Kamera-Register.">cam-reg-config.h</a>"</span>
<a name="l00021"></a>00021 <span class="preprocessor">#include "<a class="code" href="i2c_8h.html" title="Schnittstelle zu einem beliebigen I2C Bus.">i2c.h</a>"</span>
<a name="l00022"></a>00022 
<a name="l00023"></a>00023 <span class="comment">//Bayer Conversion Filter</span>
<a name="l00024"></a>00024 <span class="preprocessor">#include "bayer-lcv.h"</span>
<a name="l00025"></a>00025 <span class="preprocessor">#include "<a class="code" href="bmp-header_8h.html" title="Enthält den Header eines Bitmaps.">bmp-header.h</a>"</span>
<a name="l00026"></a>00026 
<a name="l00027"></a>00027 
<a name="l00031"></a>00031 <span class="keywordtype">void</span> <a class="code" href="cam-target_8c.html#3873992b3c53df8c894803971676954e" title="Buffer initialisieren.">lcv_cam_registers_buffer_init</a>();
<a name="l00035"></a><a class="code" href="cam-target_8c.html#840debf3236acd5f6065c96fda376f0c">00035</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> <a class="code" href="cam-target_8c.html#840debf3236acd5f6065c96fda376f0c" title="Grösse des Buffers.">cam_registers_buffer_cnt</a> = <span class="keyword">sizeof</span>(<a class="code" href="cam-reg-config_8h.html#29a2d67ac8fcb996d490c3dfa151b710" title="Die Registerkonfigurationen Die Werte wurden aus dem Datenblatt des CMOS Sensors...">cam_reg_config</a>) / <span class="keyword">sizeof</span>(*<a class="code" href="cam-reg-config_8h.html#29a2d67ac8fcb996d490c3dfa151b710" title="Die Registerkonfigurationen Die Werte wurden aus dem Datenblatt des CMOS Sensors...">cam_reg_config</a>);
<a name="l00036"></a>00036 
<a name="l00040"></a><a class="code" href="cam-target_8c.html#a911f9f1314ef1bc68e686cc870cdabe">00040</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> <a class="code" href="cam-target_8c.html#a911f9f1314ef1bc68e686cc870cdabe" title="Bufferarray für Kameraregister.">cam_registers_buffer</a>[<span class="keyword">sizeof</span>(<a class="code" href="cam-reg-config_8h.html#29a2d67ac8fcb996d490c3dfa151b710" title="Die Registerkonfigurationen Die Werte wurden aus dem Datenblatt des CMOS Sensors...">cam_reg_config</a>) / <span class="keyword">sizeof</span>(*<a class="code" href="cam-reg-config_8h.html#29a2d67ac8fcb996d490c3dfa151b710" title="Die Registerkonfigurationen Die Werte wurden aus dem Datenblatt des CMOS Sensors...">cam_reg_config</a>)];
<a name="l00041"></a>00041 
<a name="l00045"></a><a class="code" href="cam-target_8c.html#f6fd4975878759cf79c88e5e01faf8be">00045</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> <a class="code" href="cam-target_8c.html#f6fd4975878759cf79c88e5e01faf8be" title="Buffer initialisiert.">cam_registers_buffer_initialized</a> = <a class="code" href="lcv-config_8h.html#a93f0eb578d23995850d61f7d61c55c1">FALSE</a>;
<a name="l00046"></a>00046 
<a name="l00050"></a><a class="code" href="cam-target_8c.html#1f32b4aea1ffaa63f852d412d73323b7">00050</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> <a class="code" href="cam-target_8c.html#1f32b4aea1ffaa63f852d412d73323b7" title="Buffer aktivieren, deaktivieren.">enable_buffer</a> = <a class="code" href="lcv-config_8h.html#a8cecfc5c5c054d2875c03e77b7be15d" title="Booleans.">TRUE</a>;
<a name="l00051"></a>00051 
<a name="l00052"></a>00052 <span class="comment">/*</span>
<a name="l00053"></a>00053 <span class="comment"> * Wandelt 10 Bit Pixel Bilder (2 Byte Pro Pixel) in 1 Bit Pixel Bilder (1 Byte pro Pixel</span>
<a name="l00054"></a>00054 <span class="comment"> * @param pic Bildarray</span>
<a name="l00055"></a>00055 <span class="comment"> * @param size Bildgrösse</span>
<a name="l00056"></a>00056 <span class="comment"> */</span>
<a name="l00057"></a><a class="code" href="cam-target_8c.html#593428c523e89b29b7b724e6120e289f">00057</a> <span class="keywordtype">void</span> <a class="code" href="cam-target_8c.html#593428c523e89b29b7b724e6120e289f">Raw10To8bit</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>* pic, <span class="keywordtype">int</span> size)
<a name="l00058"></a>00058 {
<a name="l00059"></a>00059         <span class="keywordtype">int</span> i;
<a name="l00060"></a>00060         <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> msb, lsb, <span class="keyword">new</span>;
<a name="l00061"></a>00061 
<a name="l00062"></a>00062         <span class="keywordflow">for</span> (i=0;i&lt;size;i++)
<a name="l00063"></a>00063         {       
<a name="l00064"></a>00064                 msb = (<span class="keywordtype">unsigned</span> char) *(pic+2*i+1);
<a name="l00065"></a>00065                 lsb = (<span class="keywordtype">unsigned</span> char) *(pic+2*i);
<a name="l00066"></a>00066                 <span class="keyword">new</span> = (<span class="keywordtype">unsigned</span> char)((msb&lt;&lt;6) | (lsb&amp;0x00ff)&gt;&gt;2);
<a name="l00067"></a>00067                 memset(pic+i, <span class="keyword">new</span>, 1);
<a name="l00068"></a>00068         }
<a name="l00069"></a>00069 }
<a name="l00070"></a>00070 
<a name="l00071"></a><a class="code" href="cam-target_8c.html#abd5b4037cc6f83069eaf5718d5ed872">00071</a> <a class="code" href="structlcv__picture.html" title="Bilderstruktur für unsigned 8-bit Bilder.">lcv_picture</a> <a class="code" href="cam-linux32_8c.html#abd5b4037cc6f83069eaf5718d5ed872" title="Holt ein Bild von der Kamera.">lcv_capture_frame</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* filename)
<a name="l00072"></a>00072 {        
<a name="l00073"></a>00073         <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>* buffer;
<a name="l00074"></a>00074         <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>* bgr_buffer;       
<a name="l00075"></a>00075         <span class="keywordtype">int</span> cam_dev;
<a name="l00076"></a>00076         <span class="keywordtype">int</span> i, imagesize;
<a name="l00077"></a>00077         <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> width, height;
<a name="l00078"></a>00078         <span class="keywordtype">char</span>* error_msg;  
<a name="l00079"></a>00079         <a class="code" href="structlcv__picture.html" title="Bilderstruktur für unsigned 8-bit Bilder.">lcv_picture</a> res_pic;
<a name="l00080"></a>00080         
<a name="l00081"></a>00081         <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> beyer_offset = 1078;
<a name="l00082"></a>00082                 
<a name="l00083"></a>00083          
<a name="l00084"></a>00084         <span class="comment">/* Prüfe ob die Bildgrösse im gültigen Bereich liegt */</span>
<a name="l00085"></a>00085         <span class="comment">/* Achtung: hier wurden für die Bildausmasse die Default Werte verwendet, die möglichen Werte gehen</span>
<a name="l00086"></a>00086 <span class="comment">         * über den möglichen Bereich heraus!! */</span>
<a name="l00087"></a>00087         width  = <a class="code" href="cam-linux32_8c.html#87fa1748b8561b93887e94d6a1e46dfa" title="Liest den Wert einer Registerkonfiguration.">lcv_config_read</a>(<a class="code" href="cam-config_8h.html#0e03dbfdd5f8c2ea81d0ee40c7c3e1fb">REG_WINDOW_WIDTH</a>);
<a name="l00088"></a>00088         height = <a class="code" href="cam-linux32_8c.html#87fa1748b8561b93887e94d6a1e46dfa" title="Liest den Wert einer Registerkonfiguration.">lcv_config_read</a>(<a class="code" href="cam-config_8h.html#46a42d02832af075fb639880da5e53ee">REG_WINDOW_HEIGHT</a>);
<a name="l00089"></a>00089                 
<a name="l00090"></a>00090         <span class="keywordflow">if</span> (width &gt; <a class="code" href="cam-reg-config_8h.html#29a2d67ac8fcb996d490c3dfa151b710" title="Die Registerkonfigurationen Die Werte wurden aus dem Datenblatt des CMOS Sensors...">cam_reg_config</a>[<a class="code" href="cam-config_8h.html#0e03dbfdd5f8c2ea81d0ee40c7c3e1fb">REG_WINDOW_WIDTH</a>].max_val) {
<a name="l00091"></a>00091                 error_msg = <span class="stringliteral">"The captured picture extends the maximal possible window width"</span>;           
<a name="l00092"></a>00092                 printf(<span class="stringliteral">"%s %s:\nError: %s\n"</span>, <span class="stringliteral">"In Function"</span>, __FUNCTION__, error_msg);
<a name="l00093"></a>00093                 <a class="code" href="log_8c.html#ff9ff7830b2121dcd8e64d7cc1252534" title="Schreibt einen Fehler-Eintrag in die Protokolldatei.">lcv_log_error</a>(error_msg, __FUNCTION__);
<a name="l00094"></a>00094                 exit(-1);
<a name="l00095"></a>00095         }
<a name="l00096"></a>00096         
<a name="l00097"></a>00097         <span class="keywordflow">if</span> (height &gt; <a class="code" href="cam-reg-config_8h.html#29a2d67ac8fcb996d490c3dfa151b710" title="Die Registerkonfigurationen Die Werte wurden aus dem Datenblatt des CMOS Sensors...">cam_reg_config</a>[<a class="code" href="cam-config_8h.html#46a42d02832af075fb639880da5e53ee">REG_WINDOW_HEIGHT</a>].max_val) {
<a name="l00098"></a>00098                 error_msg = <span class="stringliteral">"The captured picture extends the maximal possible window height"</span>;          
<a name="l00099"></a>00099                 printf(<span class="stringliteral">"%s %s:\nError: %s\n"</span>, <span class="stringliteral">"In Function"</span>, __FUNCTION__, error_msg);
<a name="l00100"></a>00100                 <a class="code" href="log_8c.html#ff9ff7830b2121dcd8e64d7cc1252534" title="Schreibt einen Fehler-Eintrag in die Protokolldatei.">lcv_log_error</a>(error_msg, __FUNCTION__);
<a name="l00101"></a>00101                 exit(-1);
<a name="l00102"></a>00102         }
<a name="l00103"></a>00103          
<a name="l00104"></a>00104         imagesize = width*height;
<a name="l00105"></a>00105                  
<a name="l00106"></a>00106         <span class="comment">/* Speicher für Rohdaten und Bitmapheader alloziieren */</span>
<a name="l00107"></a>00107         buffer = (<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *)malloc(2*imagesize + beyer_offset); <span class="comment">//2 byte per pixel</span>
<a name="l00108"></a>00108 
<a name="l00109"></a>00109         <span class="comment">/* Kamera öffnen */</span>
<a name="l00110"></a>00110         cam_dev = open(<a class="code" href="cam-config_8h.html#88583b60f6f942affea08617565a7777">CAM_DEVICE</a>, O_RDONLY, 0);
<a name="l00111"></a>00111         <span class="keywordflow">if</span> (cam_dev == -1) {
<a name="l00112"></a>00112                 free(buffer);
<a name="l00113"></a>00113                 exit(-1); <span class="comment">/*schwerer Fehler */</span>
<a name="l00114"></a>00114         }
<a name="l00115"></a>00115         
<a name="l00116"></a>00116         <span class="comment">/* Rohe Bilddaten von PPI lesen */</span>      
<a name="l00117"></a>00117         <span class="comment">/* ACHTUNG!! Schleife entfernen Treiberfehler wurde in der neuen Version behoben*/</span>      
<a name="l00118"></a>00118         <span class="keywordflow">for</span> (i = 0; i &lt; 10; i++) {
<a name="l00119"></a>00119                 read(cam_dev, buffer + beyer_offset, imagesize);
<a name="l00120"></a>00120                 usleep(2000);
<a name="l00121"></a>00121         }
<a name="l00122"></a>00122          
<a name="l00123"></a>00123         <span class="comment">/* Von 10bit Pixel (2 Bytes) zu 8bit Pixels (1Byte) konvertieren*/</span>
<a name="l00124"></a>00124         <a class="code" href="cam-target_8c.html#593428c523e89b29b7b724e6120e289f">Raw10To8bit</a>(buffer + beyer_offset, imagesize);
<a name="l00125"></a>00125         
<a name="l00126"></a>00126         
<a name="l00127"></a>00127         bgr_buffer = cfa2bgr_DoBayerFiltering(buffer + beyer_offset, <span class="keyword">sizeof</span>(<a class="code" href="bmp-header_8h.html#b165ce8cc6014877877b4a697968d778" title="Definition eines 24 Bit BMP Headers mit den Farbinformationen in je einem Byte für...">bmphead_bgr</a>), width, height); 
<a name="l00128"></a>00128         free(buffer); 
<a name="l00129"></a>00129         
<a name="l00130"></a>00130         <span class="comment">/* PPI schliessen */</span>
<a name="l00131"></a>00131         close(cam_dev);
<a name="l00132"></a>00132                 
<a name="l00133"></a>00133         res_pic.<a class="code" href="structlcv__picture.html#d1fedb162e9fe3b19a1a70c24009a468">height</a> = height;
<a name="l00134"></a>00134         res_pic.<a class="code" href="structlcv__picture.html#e83ac2254761aa2c6678f140565ddf52">width</a>  = width;
<a name="l00135"></a>00135 
<a name="l00136"></a>00136         <span class="comment">/* 3 Byte pro Pixel alloziieren */</span>
<a name="l00137"></a>00137         res_pic.<a class="code" href="structlcv__picture.html#2c2b64613effb4dccb763bb5ba4670f6">data</a> = (<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>*)malloc(imagesize*3);
<a name="l00138"></a>00138         res_pic.<a class="code" href="structlcv__picture.html#d1be6c681d8345ac3bbc3820ed8e3fee">length</a> = imagesize*3;
<a name="l00139"></a>00139         res_pic.<a class="code" href="structlcv__picture.html#6bc2403299e0f61e26c4ade67d0ccacf">type</a> = <a class="code" href="lcv-structs_8h.html#b1860e6c3843411127d01321e616fd24ac1f6d8408e4448449149fc6ee90de65">IMG_BGR</a>;
<a name="l00140"></a>00140                 
<a name="l00141"></a>00141         (void)memcpy(res_pic.<a class="code" href="structlcv__picture.html#2c2b64613effb4dccb763bb5ba4670f6">data</a>, (<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>*)(bgr_buffer + <span class="keyword">sizeof</span>(<a class="code" href="bmp-header_8h.html#b165ce8cc6014877877b4a697968d778" title="Definition eines 24 Bit BMP Headers mit den Farbinformationen in je einem Byte für...">bmphead_bgr</a>)), imagesize*3);
<a name="l00142"></a>00142         free(bgr_buffer);               
<a name="l00143"></a>00143         <span class="keywordflow">return</span> res_pic;         
<a name="l00144"></a>00144 }
<a name="l00145"></a>00145 
<a name="l00146"></a><a class="code" href="cam-target_8c.html#dc4ab6ea6f9ed6dd991488af90fade92">00146</a> <a class="code" href="structlcv__picture.html" title="Bilderstruktur für unsigned 8-bit Bilder.">lcv_picture</a> <a class="code" href="cam-linux32_8c.html#fccc314a597adadce86329989470f8ba" title="Holt ein Bildausschnutt von der Kamera.">lcv_capture_region</a>(<span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> start_x, <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> start_y, <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> width, <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> height, <span class="keyword">const</span> <span class="keywordtype">char</span>* filename)
<a name="l00147"></a>00147 {
<a name="l00148"></a>00148         <a class="code" href="structlcv__picture.html" title="Bilderstruktur für unsigned 8-bit Bilder.">lcv_picture</a> ret_pic;    
<a name="l00149"></a>00149         <span class="keywordtype">char</span> error_msg[256];
<a name="l00150"></a>00150         
<a name="l00151"></a>00151         <span class="comment">/* Function is not yet fully implemented */</span>
<a name="l00152"></a>00152         sprintf(error_msg, <span class="stringliteral">"Function not implemented"</span>); 
<a name="l00153"></a>00153         printf(<span class="stringliteral">"%s %s:\nError: %s\n"</span>, <span class="stringliteral">"In Function"</span>, __FUNCTION__, error_msg);
<a name="l00154"></a>00154         <a class="code" href="log_8c.html#ff9ff7830b2121dcd8e64d7cc1252534" title="Schreibt einen Fehler-Eintrag in die Protokolldatei.">lcv_log_error</a>(error_msg, __FUNCTION__);
<a name="l00155"></a>00155         exit(-1);
<a name="l00156"></a>00156         
<a name="l00157"></a>00157         
<a name="l00158"></a>00158         <span class="comment">/* Lokaler Buffer zur Zwischenspeicherung der Kameraregister 1-4 */</span>
<a name="l00159"></a>00159         <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> cam_reg_region_buffer[4];
<a name="l00160"></a>00160         
<a name="l00161"></a>00161         <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> nWidth, nHeight, nStart_x, nStart_y;
<a name="l00162"></a>00162         
<a name="l00163"></a>00163         nWidth   = width;
<a name="l00164"></a>00164         nHeight  = height;
<a name="l00165"></a>00165         nStart_x = start_x;
<a name="l00166"></a>00166         nStart_y = start_y;
<a name="l00167"></a>00167         
<a name="l00168"></a>00168         <span class="comment">/* Auf legale Werte prüfen , Korrektur auf maximal mögliche Fenstergrösse */</span>
<a name="l00169"></a>00169         <span class="keywordflow">if</span> (nStart_x &lt; <a class="code" href="cam-reg-config_8h.html#29a2d67ac8fcb996d490c3dfa151b710" title="Die Registerkonfigurationen Die Werte wurden aus dem Datenblatt des CMOS Sensors...">cam_reg_config</a>[<a class="code" href="cam-config_8h.html#68f230679792e1a9d62495b02b261f6f">REG_COLUMN_START</a>].min_val) {
<a name="l00170"></a>00170                 sprintf(error_msg, <span class="stringliteral">"The start_x variable value (%u) is smaller than the minimal legal value: %u"</span>, nStart_x , <a class="code" href="cam-reg-config_8h.html#29a2d67ac8fcb996d490c3dfa151b710" title="Die Registerkonfigurationen Die Werte wurden aus dem Datenblatt des CMOS Sensors...">cam_reg_config</a>[<a class="code" href="cam-config_8h.html#68f230679792e1a9d62495b02b261f6f">REG_COLUMN_START</a>].min_val);         
<a name="l00171"></a>00171                 printf(<span class="stringliteral">"%s %s:\nError: %s\n"</span>, <span class="stringliteral">"In Function"</span>, __FUNCTION__, error_msg);
<a name="l00172"></a>00172                 <a class="code" href="log_8c.html#ff9ff7830b2121dcd8e64d7cc1252534" title="Schreibt einen Fehler-Eintrag in die Protokolldatei.">lcv_log_error</a>(error_msg, __FUNCTION__);
<a name="l00173"></a>00173                 exit(-1); 
<a name="l00174"></a>00174         }
<a name="l00175"></a>00175         <span class="keywordflow">if</span> (nStart_x &gt; <a class="code" href="cam-reg-config_8h.html#29a2d67ac8fcb996d490c3dfa151b710" title="Die Registerkonfigurationen Die Werte wurden aus dem Datenblatt des CMOS Sensors...">cam_reg_config</a>[<a class="code" href="cam-config_8h.html#68f230679792e1a9d62495b02b261f6f">REG_COLUMN_START</a>].max_val) {
<a name="l00176"></a>00176                 sprintf(error_msg, <span class="stringliteral">"The start_x variable value (%u) is bigger than the maximal legal value: %u"</span>, nStart_x , <a class="code" href="cam-reg-config_8h.html#29a2d67ac8fcb996d490c3dfa151b710" title="Die Registerkonfigurationen Die Werte wurden aus dem Datenblatt des CMOS Sensors...">cam_reg_config</a>[<a class="code" href="cam-config_8h.html#68f230679792e1a9d62495b02b261f6f">REG_COLUMN_START</a>].max_val);          
<a name="l00177"></a>00177                 printf(<span class="stringliteral">"%s %s:\nError: %s\n"</span>, <span class="stringliteral">"In Function"</span>, __FUNCTION__, error_msg);
<a name="l00178"></a>00178                 <a class="code" href="log_8c.html#ff9ff7830b2121dcd8e64d7cc1252534" title="Schreibt einen Fehler-Eintrag in die Protokolldatei.">lcv_log_error</a>(error_msg, __FUNCTION__);
<a name="l00179"></a>00179                 exit(-1); 
<a name="l00180"></a>00180         }
<a name="l00181"></a>00181         
<a name="l00182"></a>00182         <span class="keywordflow">if</span> (nStart_y &lt; <a class="code" href="cam-reg-config_8h.html#29a2d67ac8fcb996d490c3dfa151b710" title="Die Registerkonfigurationen Die Werte wurden aus dem Datenblatt des CMOS Sensors...">cam_reg_config</a>[<a class="code" href="cam-config_8h.html#9118c7f103fcc09a2104cd6efca36394">REG_ROW_START</a>].min_val) {
<a name="l00183"></a>00183                 sprintf(error_msg, <span class="stringliteral">"The start_y variable value (%u) is smaller than the minimal legal value: %u"</span>, nStart_y , <a class="code" href="cam-reg-config_8h.html#29a2d67ac8fcb996d490c3dfa151b710" title="Die Registerkonfigurationen Die Werte wurden aus dem Datenblatt des CMOS Sensors...">cam_reg_config</a>[<a class="code" href="cam-config_8h.html#9118c7f103fcc09a2104cd6efca36394">REG_ROW_START</a>].min_val);            
<a name="l00184"></a>00184                 printf(<span class="stringliteral">"%s %s:\nError: %s\n"</span>, <span class="stringliteral">"In Function"</span>, __FUNCTION__, error_msg);
<a name="l00185"></a>00185                 <a class="code" href="log_8c.html#ff9ff7830b2121dcd8e64d7cc1252534" title="Schreibt einen Fehler-Eintrag in die Protokolldatei.">lcv_log_error</a>(error_msg, __FUNCTION__);
<a name="l00186"></a>00186                 exit(-1); 
<a name="l00187"></a>00187         }
<a name="l00188"></a>00188         <span class="keywordflow">if</span> (nStart_y &gt; <a class="code" href="cam-reg-config_8h.html#29a2d67ac8fcb996d490c3dfa151b710" title="Die Registerkonfigurationen Die Werte wurden aus dem Datenblatt des CMOS Sensors...">cam_reg_config</a>[<a class="code" href="cam-config_8h.html#9118c7f103fcc09a2104cd6efca36394">REG_ROW_START</a>].max_val) {
<a name="l00189"></a>00189                 sprintf(error_msg, <span class="stringliteral">"The start_y variable value (%u) is bigger than the maximal legal value: %u"</span>, nStart_y , <a class="code" href="cam-reg-config_8h.html#29a2d67ac8fcb996d490c3dfa151b710" title="Die Registerkonfigurationen Die Werte wurden aus dem Datenblatt des CMOS Sensors...">cam_reg_config</a>[<a class="code" href="cam-config_8h.html#9118c7f103fcc09a2104cd6efca36394">REG_ROW_START</a>].max_val);             
<a name="l00190"></a>00190                 printf(<span class="stringliteral">"%s %s:\nError: %s\n"</span>, <span class="stringliteral">"In Function"</span>, __FUNCTION__, error_msg);
<a name="l00191"></a>00191                 <a class="code" href="log_8c.html#ff9ff7830b2121dcd8e64d7cc1252534" title="Schreibt einen Fehler-Eintrag in die Protokolldatei.">lcv_log_error</a>(error_msg, __FUNCTION__);
<a name="l00192"></a>00192                 exit(-1); 
<a name="l00193"></a>00193 
<a name="l00194"></a>00194         }
<a name="l00195"></a>00195         
<a name="l00196"></a>00196         <span class="comment">/* Achtung: hier wurden für die Bildausmasse die Default Werte verwendet, die möglichen Werte gehen</span>
<a name="l00197"></a>00197 <span class="comment">         * über den möglichen Bereich heraus!! */</span>
<a name="l00198"></a>00198         <span class="keywordflow">if</span> (nWidth &gt; <a class="code" href="cam-reg-config_8h.html#29a2d67ac8fcb996d490c3dfa151b710" title="Die Registerkonfigurationen Die Werte wurden aus dem Datenblatt des CMOS Sensors...">cam_reg_config</a>[<a class="code" href="cam-config_8h.html#0e03dbfdd5f8c2ea81d0ee40c7c3e1fb">REG_WINDOW_WIDTH</a>].max_val) {
<a name="l00199"></a>00199                 sprintf(error_msg, <span class="stringliteral">"The width variable (%u) extends the maximal possible window width in this register configuration"</span>, width);          
<a name="l00200"></a>00200                 printf(<span class="stringliteral">"%s %s:\nError: %s\n"</span>, <span class="stringliteral">"In Function"</span>, __FUNCTION__, error_msg);
<a name="l00201"></a>00201                 <a class="code" href="log_8c.html#ff9ff7830b2121dcd8e64d7cc1252534" title="Schreibt einen Fehler-Eintrag in die Protokolldatei.">lcv_log_error</a>(error_msg, __FUNCTION__);
<a name="l00202"></a>00202                 exit(-1);               
<a name="l00203"></a>00203         }
<a name="l00204"></a>00204         <span class="keywordflow">if</span> (nHeight &gt; <a class="code" href="cam-reg-config_8h.html#29a2d67ac8fcb996d490c3dfa151b710" title="Die Registerkonfigurationen Die Werte wurden aus dem Datenblatt des CMOS Sensors...">cam_reg_config</a>[<a class="code" href="cam-config_8h.html#46a42d02832af075fb639880da5e53ee">REG_WINDOW_HEIGHT</a>].max_val) {
<a name="l00205"></a>00205                 sprintf(error_msg, <span class="stringliteral">"The height variable (%u) extends the maximal possible window height in this register configuration"</span>, height);               
<a name="l00206"></a>00206                 printf(<span class="stringliteral">"%s %s:\nError: %s\n"</span>, <span class="stringliteral">"In Function"</span>, __FUNCTION__, error_msg);
<a name="l00207"></a>00207                 <a class="code" href="log_8c.html#ff9ff7830b2121dcd8e64d7cc1252534" title="Schreibt einen Fehler-Eintrag in die Protokolldatei.">lcv_log_error</a>(error_msg, __FUNCTION__);
<a name="l00208"></a>00208                 exit(-1);                       
<a name="l00209"></a>00209         }
<a name="l00210"></a>00210         
<a name="l00211"></a>00211         <span class="comment">/* Register sichern, erst danach neue Registerwerte schreiben */</span>
<a name="l00212"></a>00212         cam_reg_region_buffer[0] = <a class="code" href="cam-linux32_8c.html#87fa1748b8561b93887e94d6a1e46dfa" title="Liest den Wert einer Registerkonfiguration.">lcv_config_read</a>(<a class="code" href="cam-config_8h.html#68f230679792e1a9d62495b02b261f6f">REG_COLUMN_START</a>);
<a name="l00213"></a>00213         cam_reg_region_buffer[1] = <a class="code" href="cam-linux32_8c.html#87fa1748b8561b93887e94d6a1e46dfa" title="Liest den Wert einer Registerkonfiguration.">lcv_config_read</a>(<a class="code" href="cam-config_8h.html#9118c7f103fcc09a2104cd6efca36394">REG_ROW_START</a>);
<a name="l00214"></a>00214         cam_reg_region_buffer[2] = <a class="code" href="cam-linux32_8c.html#87fa1748b8561b93887e94d6a1e46dfa" title="Liest den Wert einer Registerkonfiguration.">lcv_config_read</a>(<a class="code" href="cam-config_8h.html#0e03dbfdd5f8c2ea81d0ee40c7c3e1fb">REG_WINDOW_WIDTH</a>);
<a name="l00215"></a>00215         cam_reg_region_buffer[3] = <a class="code" href="cam-linux32_8c.html#87fa1748b8561b93887e94d6a1e46dfa" title="Liest den Wert einer Registerkonfiguration.">lcv_config_read</a>(<a class="code" href="cam-config_8h.html#46a42d02832af075fb639880da5e53ee">REG_WINDOW_HEIGHT</a>);
<a name="l00216"></a>00216         
<a name="l00217"></a>00217                  
<a name="l00218"></a>00218         <span class="comment">/* Neue, temporäre Registerwerte schreiben */</span> 
<a name="l00219"></a>00219         <span class="keywordflow">if</span> (<a class="code" href="cam-linux32_8c.html#7ad8b70964b854eb97169bd1469ba161" title="Schreibt eine Registerkonfiguration.">lcv_config_write</a>(<a class="code" href="cam-config_8h.html#68f230679792e1a9d62495b02b261f6f">REG_COLUMN_START</a>, nStart_x) &lt; 0) {
<a name="l00220"></a>00220                 sprintf(error_msg, <span class="stringliteral">"Could not set a config-register (REG_COLUMN_START)"</span>);       
<a name="l00221"></a>00221                 printf(<span class="stringliteral">"%s %s:\nError: %s\n"</span>, <span class="stringliteral">"In Function"</span>, __FUNCTION__, error_msg);
<a name="l00222"></a>00222                 <a class="code" href="log_8c.html#ff9ff7830b2121dcd8e64d7cc1252534" title="Schreibt einen Fehler-Eintrag in die Protokolldatei.">lcv_log_error</a>(error_msg, __FUNCTION__);
<a name="l00223"></a>00223                 exit(-1);
<a name="l00224"></a>00224         }
<a name="l00225"></a>00225         <span class="keywordflow">if</span> (<a class="code" href="cam-linux32_8c.html#7ad8b70964b854eb97169bd1469ba161" title="Schreibt eine Registerkonfiguration.">lcv_config_write</a>(<a class="code" href="cam-config_8h.html#9118c7f103fcc09a2104cd6efca36394">REG_ROW_START</a>, nStart_y) &lt; 0) {
<a name="l00226"></a>00226                 sprintf(error_msg, <span class="stringliteral">"Could not set a config-register (REG_ROW_START)"</span>);
<a name="l00227"></a>00227                 printf(<span class="stringliteral">"%s %s:\nError: %s\n"</span>, <span class="stringliteral">"In Function"</span>, __FUNCTION__, error_msg);
<a name="l00228"></a>00228                 <a class="code" href="log_8c.html#ff9ff7830b2121dcd8e64d7cc1252534" title="Schreibt einen Fehler-Eintrag in die Protokolldatei.">lcv_log_error</a>(error_msg, __FUNCTION__);
<a name="l00229"></a>00229                 exit(-1);
<a name="l00230"></a>00230         }
<a name="l00231"></a>00231         <span class="keywordflow">if</span> (<a class="code" href="cam-linux32_8c.html#7ad8b70964b854eb97169bd1469ba161" title="Schreibt eine Registerkonfiguration.">lcv_config_write</a>(<a class="code" href="cam-config_8h.html#0e03dbfdd5f8c2ea81d0ee40c7c3e1fb">REG_WINDOW_WIDTH</a>, nWidth) &lt; 0) {
<a name="l00232"></a>00232                 sprintf(error_msg, <span class="stringliteral">"Could not set a config-register (REG_WINDOW_WIDTH)"</span>);
<a name="l00233"></a>00233                 printf(<span class="stringliteral">"%s %s:\nError: %s\n"</span>, <span class="stringliteral">"In Function"</span>, __FUNCTION__, error_msg);
<a name="l00234"></a>00234                 <a class="code" href="log_8c.html#ff9ff7830b2121dcd8e64d7cc1252534" title="Schreibt einen Fehler-Eintrag in die Protokolldatei.">lcv_log_error</a>(error_msg, __FUNCTION__);
<a name="l00235"></a>00235                 exit(-1);
<a name="l00236"></a>00236         }
<a name="l00237"></a>00237         <span class="keywordflow">if</span> (<a class="code" href="cam-linux32_8c.html#7ad8b70964b854eb97169bd1469ba161" title="Schreibt eine Registerkonfiguration.">lcv_config_write</a>(<a class="code" href="cam-config_8h.html#46a42d02832af075fb639880da5e53ee">REG_WINDOW_HEIGHT</a>, nHeight) &lt; 0) {
<a name="l00238"></a>00238                 sprintf(error_msg, <span class="stringliteral">"Could not set a config-register (REG_WINDOW_HEIGHT)"</span>);
<a name="l00239"></a>00239                 printf(<span class="stringliteral">"%s %s:\nError: %s\n"</span>, <span class="stringliteral">"In Function"</span>, __FUNCTION__, error_msg);
<a name="l00240"></a>00240                 <a class="code" href="log_8c.html#ff9ff7830b2121dcd8e64d7cc1252534" title="Schreibt einen Fehler-Eintrag in die Protokolldatei.">lcv_log_error</a>(error_msg, __FUNCTION__);
<a name="l00241"></a>00241                 exit(-1);
<a name="l00242"></a>00242         }
<a name="l00243"></a>00243         
<a name="l00244"></a>00244         <span class="comment">/* Bild holen */</span>
<a name="l00245"></a>00245         ret_pic = <a class="code" href="cam-linux32_8c.html#abd5b4037cc6f83069eaf5718d5ed872" title="Holt ein Bild von der Kamera.">lcv_capture_frame</a>(<span class="stringliteral">""</span>);
<a name="l00246"></a>00246         
<a name="l00247"></a>00247         <span class="comment">/* Register mit dem ursprünglichen Wert wiederherstellen */</span>
<a name="l00248"></a>00248         <a class="code" href="cam-linux32_8c.html#7ad8b70964b854eb97169bd1469ba161" title="Schreibt eine Registerkonfiguration.">lcv_config_write</a>(<a class="code" href="cam-config_8h.html#68f230679792e1a9d62495b02b261f6f">REG_COLUMN_START</a>, cam_reg_region_buffer[0]);
<a name="l00249"></a>00249         <a class="code" href="cam-linux32_8c.html#7ad8b70964b854eb97169bd1469ba161" title="Schreibt eine Registerkonfiguration.">lcv_config_write</a>(<a class="code" href="cam-config_8h.html#9118c7f103fcc09a2104cd6efca36394">REG_ROW_START</a>, cam_reg_region_buffer[1]);
<a name="l00250"></a>00250         <a class="code" href="cam-linux32_8c.html#7ad8b70964b854eb97169bd1469ba161" title="Schreibt eine Registerkonfiguration.">lcv_config_write</a>(<a class="code" href="cam-config_8h.html#0e03dbfdd5f8c2ea81d0ee40c7c3e1fb">REG_WINDOW_WIDTH</a>, cam_reg_region_buffer[2]);
<a name="l00251"></a>00251         <a class="code" href="cam-linux32_8c.html#7ad8b70964b854eb97169bd1469ba161" title="Schreibt eine Registerkonfiguration.">lcv_config_write</a>(<a class="code" href="cam-config_8h.html#46a42d02832af075fb639880da5e53ee">REG_WINDOW_HEIGHT</a>, cam_reg_region_buffer[3]);
<a name="l00252"></a>00252                 
<a name="l00253"></a>00253         <span class="keywordflow">return</span> ret_pic;
<a name="l00254"></a>00254 }
<a name="l00255"></a>00255 
<a name="l00256"></a><a class="code" href="cam-target_8c.html#075f93aa7cc073b84b2f80d2818ee86c">00256</a> <span class="keywordtype">char</span> <a class="code" href="cam-linux32_8c.html#7ad8b70964b854eb97169bd1469ba161" title="Schreibt eine Registerkonfiguration.">lcv_config_write</a>(<span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> setting, <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> value)
<a name="l00257"></a>00257 {               
<a name="l00258"></a>00258         <span class="keywordtype">char</span> warning_msg[256];
<a name="l00259"></a>00259         
<a name="l00260"></a>00260         <span class="keywordflow">if</span> (0 &lt;= setting &amp;&amp; setting &lt; <a class="code" href="cam-reg-config_8h.html#6d1e10289ab90019ecc1e6d073dfc6ad" title="Anzahl Kameraregister.">cam_registers_cnt</a>) {
<a name="l00261"></a>00261                 <a class="code" href="structlcv__reg__config.html" title="Konfigurationsstruktur für LCV-Register.">lcv_reg_config</a> config = <a class="code" href="cam-reg-config_8h.html#29a2d67ac8fcb996d490c3dfa151b710" title="Die Registerkonfigurationen Die Werte wurden aus dem Datenblatt des CMOS Sensors...">cam_reg_config</a>[setting];
<a name="l00262"></a>00262                 
<a name="l00263"></a>00263                 <span class="keywordflow">if</span>(config.<a class="code" href="structlcv__reg__config.html#4c017d032e2797c0600a319e7c9d1a6d">min_val</a> &lt;= value &amp;&amp; value &lt;= config.<a class="code" href="structlcv__reg__config.html#2ae56857be882cf623effa62cfa141e8">max_val</a>) {
<a name="l00264"></a>00264                         
<a name="l00265"></a>00265                         <span class="comment">/* mit Register buffering */</span>
<a name="l00266"></a>00266                         <span class="keywordflow">if</span> (enable_buffer == <a class="code" href="lcv-config_8h.html#a8cecfc5c5c054d2875c03e77b7be15d" title="Booleans.">TRUE</a>) {
<a name="l00267"></a>00267                                 <span class="comment">/* neuer Registerwert -&gt; schreiben */</span>
<a name="l00268"></a>00268                                 <span class="keywordflow">if</span>(cam_registers_buffer[setting] != value) {
<a name="l00269"></a>00269                                         <a class="code" href="i2c_8c.html#aefacaff83104e4b19526ea1af6f7da5" title="Lies ein Register über einen I2C-Bus.">lcv_i2c_write_register</a>(<a class="code" href="cam-config_8h.html#b661fe4093bb19a7db1273c9e666b68c">CAM_I2C_DEVICE</a>, <a class="code" href="cam-config_8h.html#9731afcf1328de10c0f82bc5cd824e6e">CAM_DEV_ID</a>, config.<a class="code" href="structlcv__reg__config.html#0e8660865899c646b6849748b466affd">addr</a>, value);
<a name="l00270"></a>00270                                         cam_registers_buffer[setting] = value;
<a name="l00271"></a>00271                                 }
<a name="l00272"></a>00272                         } <span class="keywordflow">else</span> {
<a name="l00273"></a>00273                                 <span class="comment">/* Direkt ins Register schreiben */</span>
<a name="l00274"></a>00274                                 <a class="code" href="i2c_8c.html#aefacaff83104e4b19526ea1af6f7da5" title="Lies ein Register über einen I2C-Bus.">lcv_i2c_write_register</a>(<a class="code" href="cam-config_8h.html#b661fe4093bb19a7db1273c9e666b68c">CAM_I2C_DEVICE</a>, <a class="code" href="cam-config_8h.html#9731afcf1328de10c0f82bc5cd824e6e">CAM_DEV_ID</a>, config.<a class="code" href="structlcv__reg__config.html#0e8660865899c646b6849748b466affd">addr</a>, value);
<a name="l00275"></a>00275                         }
<a name="l00276"></a>00276                         <span class="keywordflow">return</span> <a class="code" href="lcv-config_8h.html#a8cecfc5c5c054d2875c03e77b7be15d" title="Booleans.">TRUE</a>;
<a name="l00277"></a>00277                         
<a name="l00278"></a>00278                 } <span class="keywordflow">else</span> {
<a name="l00279"></a>00279                         sprintf(warning_msg,<span class="stringliteral">"Camera Register Number %u could not be written due to an illegal value: %u\n"</span>, config.<a class="code" href="structlcv__reg__config.html#0e8660865899c646b6849748b466affd">addr</a>, value);
<a name="l00280"></a>00280                         <a class="code" href="log_8c.html#8478a914926d15bf375feb130ff51b3e" title="Schreibt einen Warnungs-Eintrag in die Protokoll-Datei.">lcv_log_warning</a>(warning_msg, __FUNCTION__);                     
<a name="l00281"></a>00281                         <span class="keywordflow">return</span> <a class="code" href="lcv-config_8h.html#a8cbb6e43280c20eb5a8f0b2db94fcc7">ERROR_ILLEGAL_VALUE</a>;
<a name="l00282"></a>00282                 }
<a name="l00283"></a>00283         } <span class="keywordflow">else</span> {
<a name="l00284"></a>00284                 sprintf(warning_msg,<span class="stringliteral">"Camera Register Number %u doesn't exist\n"</span>, setting);
<a name="l00285"></a>00285                 <a class="code" href="log_8c.html#8478a914926d15bf375feb130ff51b3e" title="Schreibt einen Warnungs-Eintrag in die Protokoll-Datei.">lcv_log_warning</a>(warning_msg, __FUNCTION__);             
<a name="l00286"></a>00286                 <span class="keywordflow">return</span> <a class="code" href="lcv-config_8h.html#1d3e305e508cdec9387e8660d0c3e67e">ERROR_ILLEGAL_SETTING</a>;
<a name="l00287"></a>00287         }
<a name="l00288"></a>00288 }
<a name="l00289"></a>00289 
<a name="l00290"></a><a class="code" href="cam-target_8c.html#672e3188bbcf535ff2e06d8539a9c13d">00290</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> <a class="code" href="cam-linux32_8c.html#87fa1748b8561b93887e94d6a1e46dfa" title="Liest den Wert einer Registerkonfiguration.">lcv_config_read</a>(<span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> setting)
<a name="l00291"></a>00291 {       
<a name="l00292"></a>00292         <span class="keywordtype">char</span> error_msg[256];
<a name="l00293"></a>00293         
<a name="l00294"></a>00294         <span class="comment">/* Buffer initialisieren falls noch nicht initialisiert </span>
<a name="l00295"></a>00295 <span class="comment">         * aus Performancegründen wird hier der Stand der Initialisierung erneut geprüft */</span>
<a name="l00296"></a>00296         <span class="keywordflow">if</span> (!cam_registers_buffer_initialized) {
<a name="l00297"></a>00297                 <a class="code" href="cam-target_8c.html#3873992b3c53df8c894803971676954e" title="Buffer initialisieren.">lcv_cam_registers_buffer_init</a>();
<a name="l00298"></a>00298         }
<a name="l00299"></a>00299         
<a name="l00300"></a>00300         <span class="keywordflow">if</span> (0 &lt;= setting &amp;&amp; setting &lt; <a class="code" href="cam-reg-config_8h.html#6d1e10289ab90019ecc1e6d073dfc6ad" title="Anzahl Kameraregister.">cam_registers_cnt</a>) {
<a name="l00301"></a>00301                 <a class="code" href="structlcv__reg__config.html" title="Konfigurationsstruktur für LCV-Register.">lcv_reg_config</a> config = <a class="code" href="cam-reg-config_8h.html#29a2d67ac8fcb996d490c3dfa151b710" title="Die Registerkonfigurationen Die Werte wurden aus dem Datenblatt des CMOS Sensors...">cam_reg_config</a>[setting];
<a name="l00302"></a>00302                 <span class="comment">/* mit Register buffering */</span>
<a name="l00303"></a>00303                 <span class="keywordflow">if</span> (enable_buffer == <a class="code" href="lcv-config_8h.html#a8cecfc5c5c054d2875c03e77b7be15d" title="Booleans.">TRUE</a>) {
<a name="l00304"></a>00304                         <span class="keywordflow">return</span> cam_registers_buffer[setting];
<a name="l00305"></a>00305                 } <span class="keywordflow">else</span> {        
<a name="l00306"></a>00306                         <span class="keywordflow">return</span> <a class="code" href="i2c_8c.html#2b821832a74e3197fecba3661422cd27" title="Schreibt ein Register über einen I2C-Bus.">lcv_i2c_read_register</a>(<a class="code" href="cam-config_8h.html#b661fe4093bb19a7db1273c9e666b68c">CAM_I2C_DEVICE</a>, <a class="code" href="cam-config_8h.html#9731afcf1328de10c0f82bc5cd824e6e">CAM_DEV_ID</a>, config.<a class="code" href="structlcv__reg__config.html#0e8660865899c646b6849748b466affd">addr</a>);
<a name="l00307"></a>00307                 }
<a name="l00308"></a>00308         } <span class="keywordflow">else</span> {
<a name="l00309"></a>00309                 sprintf(error_msg,<span class="stringliteral">"Camera Register Number %u does not exist"</span>, setting);
<a name="l00310"></a>00310                 <span class="comment">//printf("%s %s:\nWarning: %s\n", "In Function", __FUNCTION__, error_msg);</span>
<a name="l00311"></a>00311                 <a class="code" href="log_8c.html#8478a914926d15bf375feb130ff51b3e" title="Schreibt einen Warnungs-Eintrag in die Protokoll-Datei.">lcv_log_warning</a>(error_msg, __FUNCTION__);
<a name="l00312"></a>00312                 <span class="keywordflow">return</span> 0;
<a name="l00313"></a>00313         }
<a name="l00314"></a>00314 }
<a name="l00315"></a>00315 
<a name="l00316"></a><a class="code" href="cam-target_8c.html#280d093e6ddc853845445c45449fff6c">00316</a> <span class="keywordtype">char</span> <a class="code" href="cam-linux32_8c.html#280d093e6ddc853845445c45449fff6c" title="Setzt alleRegister auf ihren Standardwert.">lcv_regs_to_default</a>()
<a name="l00317"></a>00317 {
<a name="l00318"></a>00318         <span class="keywordtype">int</span> i;
<a name="l00319"></a>00319         <span class="keywordflow">for</span> (i=0; i&lt;<a class="code" href="cam-reg-config_8h.html#6d1e10289ab90019ecc1e6d073dfc6ad" title="Anzahl Kameraregister.">cam_registers_cnt</a>; i++) {
<a name="l00320"></a>00320                 <a class="code" href="cam-linux32_8c.html#7ad8b70964b854eb97169bd1469ba161" title="Schreibt eine Registerkonfiguration.">lcv_config_write</a>(i, <a class="code" href="cam-reg-config_8h.html#29a2d67ac8fcb996d490c3dfa151b710" title="Die Registerkonfigurationen Die Werte wurden aus dem Datenblatt des CMOS Sensors...">cam_reg_config</a>[i].default_val);
<a name="l00321"></a>00321         }
<a name="l00322"></a>00322         <span class="keywordflow">return</span> <a class="code" href="lcv-config_8h.html#a8cecfc5c5c054d2875c03e77b7be15d" title="Booleans.">TRUE</a>;
<a name="l00323"></a>00323 }
<a name="l00324"></a>00324 
<a name="l00325"></a><a class="code" href="cam-target_8c.html#07a0b332c7bbc5d99dabef97da819574">00325</a> <span class="keywordtype">void</span> <a class="code" href="cam-linux32_8c.html#07a0b332c7bbc5d99dabef97da819574" title="Setzt die 4 für die Bildregion verantwortlichen Register auf den Standardwert zurück...">lcv_reset_capture_frame</a>()
<a name="l00326"></a>00326 {
<a name="l00327"></a>00327         <a class="code" href="cam-linux32_8c.html#7ad8b70964b854eb97169bd1469ba161" title="Schreibt eine Registerkonfiguration.">lcv_config_write</a>(<a class="code" href="cam-config_8h.html#68f230679792e1a9d62495b02b261f6f">REG_COLUMN_START</a>, <a class="code" href="cam-reg-config_8h.html#29a2d67ac8fcb996d490c3dfa151b710" title="Die Registerkonfigurationen Die Werte wurden aus dem Datenblatt des CMOS Sensors...">cam_reg_config</a>[<a class="code" href="cam-config_8h.html#68f230679792e1a9d62495b02b261f6f">REG_COLUMN_START</a>].default_val);
<a name="l00328"></a>00328         <a class="code" href="cam-linux32_8c.html#7ad8b70964b854eb97169bd1469ba161" title="Schreibt eine Registerkonfiguration.">lcv_config_write</a>(<a class="code" href="cam-config_8h.html#9118c7f103fcc09a2104cd6efca36394">REG_ROW_START</a>, <a class="code" href="cam-reg-config_8h.html#29a2d67ac8fcb996d490c3dfa151b710" title="Die Registerkonfigurationen Die Werte wurden aus dem Datenblatt des CMOS Sensors...">cam_reg_config</a>[<a class="code" href="cam-config_8h.html#9118c7f103fcc09a2104cd6efca36394">REG_ROW_START</a>].default_val);
<a name="l00329"></a>00329         <a class="code" href="cam-linux32_8c.html#7ad8b70964b854eb97169bd1469ba161" title="Schreibt eine Registerkonfiguration.">lcv_config_write</a>(<a class="code" href="cam-config_8h.html#0e03dbfdd5f8c2ea81d0ee40c7c3e1fb">REG_WINDOW_WIDTH</a>, <a class="code" href="cam-reg-config_8h.html#29a2d67ac8fcb996d490c3dfa151b710" title="Die Registerkonfigurationen Die Werte wurden aus dem Datenblatt des CMOS Sensors...">cam_reg_config</a>[<a class="code" href="cam-config_8h.html#0e03dbfdd5f8c2ea81d0ee40c7c3e1fb">REG_WINDOW_WIDTH</a>].default_val);
<a name="l00330"></a>00330         <a class="code" href="cam-linux32_8c.html#7ad8b70964b854eb97169bd1469ba161" title="Schreibt eine Registerkonfiguration.">lcv_config_write</a>(<a class="code" href="cam-config_8h.html#46a42d02832af075fb639880da5e53ee">REG_WINDOW_HEIGHT</a>, <a class="code" href="cam-reg-config_8h.html#29a2d67ac8fcb996d490c3dfa151b710" title="Die Registerkonfigurationen Die Werte wurden aus dem Datenblatt des CMOS Sensors...">cam_reg_config</a>[<a class="code" href="cam-config_8h.html#46a42d02832af075fb639880da5e53ee">REG_WINDOW_HEIGHT</a>].default_val);     
<a name="l00331"></a>00331 }
<a name="l00332"></a>00332 
<a name="l00333"></a><a class="code" href="cam-target_8c.html#3873992b3c53df8c894803971676954e">00333</a> <span class="keywordtype">void</span> <a class="code" href="cam-target_8c.html#3873992b3c53df8c894803971676954e" title="Buffer initialisieren.">lcv_cam_registers_buffer_init</a>()
<a name="l00334"></a>00334 {
<a name="l00335"></a>00335         <span class="keywordtype">int</span> i;
<a name="l00336"></a>00336         
<a name="l00337"></a>00337         <span class="keywordflow">if</span> (!cam_registers_buffer_initialized) {
<a name="l00338"></a>00338                 <span class="keywordflow">for</span> (i=0; i &lt; <a class="code" href="cam-target_8c.html#840debf3236acd5f6065c96fda376f0c" title="Grösse des Buffers.">cam_registers_buffer_cnt</a>; i++) {
<a name="l00339"></a>00339                         cam_registers_buffer[i] = <a class="code" href="cam-reg-config_8h.html#29a2d67ac8fcb996d490c3dfa151b710" title="Die Registerkonfigurationen Die Werte wurden aus dem Datenblatt des CMOS Sensors...">cam_reg_config</a>[i].<a class="code" href="structlcv__reg__config.html#9153f7e40c3664948600e62856c20bbf">default_val</a>;
<a name="l00340"></a>00340                 }
<a name="l00341"></a>00341                 cam_registers_buffer_initialized = <a class="code" href="lcv-config_8h.html#a8cecfc5c5c054d2875c03e77b7be15d" title="Booleans.">TRUE</a>;
<a name="l00342"></a>00342         }
<a name="l00343"></a>00343 }
<a name="l00344"></a>00344 
<a name="l00345"></a><a class="code" href="cam-target_8c.html#f73241718d1a517f6e12e4ee474b5c30">00345</a> <span class="keywordtype">void</span> <a class="code" href="cam-linux32_8c.html#f73241718d1a517f6e12e4ee474b5c30" title="Aktiviert bzw.">lcv_reg_buffering</a>(<span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> enable) {
<a name="l00346"></a>00346         enable_buffer = enable; 
<a name="l00347"></a>00347 }
<a name="l00348"></a>00348 
</pre></div><hr size="1"><address style="text-align: right;"><small>Erzeugt am Wed Dec 19 16:38:17 2007 für LCV Framework von&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.3 </small></address>
</body>
</html>
